//
//  ShellInvitationViewController.m
//  ShellWallert
//
//  Created by lvzhao on 2019/10/4.
//  Copyright © 2019 VV. All rights reserved.
//

#import "ShellInvitationViewController.h"
#import "ShellInvitationView.h"
#import "ShellFriendViewModel.h"
#import "ShellFriendViewController.h"

@interface ShellInvitationViewController ()

@property (nonatomic,strong) ShellInvitationView *invitationView;

@property (nonatomic,strong) ShellFriendViewModel *viewModel;


@end

@implementation ShellInvitationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setupUI];
    
    self.title = LZLocalizedString(@"邀请节点");
    
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.barTintColor = COLOR_BACKGROUND;

}



#pragma mark - setupUI
- (void)setupUI{
    [self.view addSubview:self.invitationView];
    [self.invitationView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
    
    
    UIButton *friendBtn = [UIButton lz_buttonTitle:LZLocalizedString(@"我的好友") titleColor:UIColorHex(0xFFFFFF) fontSize:14];
    friendBtn.frame = CGRectMake(0, 0, 80, 20);
    friendBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    [self initBarItem:friendBtn withType:1];
    
    [[friendBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
        ShellFriendViewController *friendVC = [[ShellFriendViewController alloc] init];
        [LZTool.currentViewController.navigationController pushViewController:friendVC animated:YES];
    }];
}

#pragma mark - actions

#pragma mark - custool

#pragma mark - get && set
- (ShellInvitationView *)invitationView{
    
    if(!_invitationView){
        _invitationView = [[ShellInvitationView alloc] initViewModel:self.viewModel];
    }
    return _invitationView;
}

- (ShellFriendViewModel *)viewModel{
    if(!_viewModel){
        _viewModel = [[ShellFriendViewModel alloc] init];
    }
    return _viewModel;
}



@end
